package com.app.megaprosoft.modyimcarcare;

import java.sql.Connection;
import java.sql.ResultSet;
import java.util.Calendar;

import com.app.megaprosoft.DB.Connect;

import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.IBinder;
import android.os.SystemClock;
import android.widget.Toast;


public class Service_UpdateToServer extends Service{
	
//    Connect con = new Connect(); 
//    Connection conn = con.Connect();
//    ResultSet rs = null;
//	
//	@Override
//	public IBinder onBind(Intent arg0) {
//		// TODO Auto-generated method stub
////		Toast.makeText(this, Calendar.getInstance().get(Calendar.MINUTE), Toast.LENGTH_LONG).show();
//		return null;
//	}
//
//	@Override
//	public void onCreate() {
//		// TODO Auto-generated method stub
//		Toast.makeText(this, "Start ffflawwww", Toast.LENGTH_LONG).show();
//		super.onCreate();
//	}
//
//	@Override
//	public void onDestroy() {
//		// TODO Auto-generated method stub
//		Toast.makeText(this, "Stopppppp ffflawwww", Toast.LENGTH_LONG).show();
//		super.onDestroy();
//	}
//	
//	/** indicates how to behave if the service is killed */
//	   int mStartMode;
//	   /** interface for clients that bind */
//	   IBinder mBinder;     
//	   /** indicates whether onRebind should be used */
//	   boolean mAllowRebind;
//
//	   /** Called when the service is being created. */
//	   @Override
//	   public void onCreate() {
//	     
//	   }
//
//	   /** The service is starting, due to a call to startService() */
//	   @Override
//	   public int onStartCommand(Intent intent, int flags, int startId) {
//	      return mStartMode;
//	   }
//
//	   /** A client is binding to the service with bindService() */
//	   @Override
//	   public IBinder onBind(Intent intent) {
//	      return mBinder;
//	   }
//
//	   /** Called when all clients have unbound with unbindService() */
//	   @Override
//	   public boolean onUnbind(Intent intent) {
//	      return mAllowRebind;
//	   }
//
//	   /** Called when a client is binding to the service with bindService()*/
//	   @Override
//	   public void onRebind(Intent intent) {
//
//	   }
//
//	   /** Called when The service is no longer used and is being destroyed */
//	   @Override
//	   public void onDestroy() {
//
//	   }
//	
	
	 @Override
	   public IBinder onBind(Intent arg0) {
//		 Toast.makeText(this, "Service Binder", Toast.LENGTH_SHORT).show();
	      return null;
	   }

	   @Override
	   public int onStartCommand(Intent intent, int flags, int startId) {
	      // Let it continue running until it is stopped.
//	      Toast.makeText(this, "Service Started", Toast.LENGTH_LONG).show();
//	      while(true){
//	    	  Toast.makeText(this, Calendar.getInstance().get(Calendar.SECOND), Toast.LENGTH_LONG).show();
//	      }
	      return START_STICKY;
	   }
	   @Override
	   public void onDestroy() {
	      super.onDestroy();
	      Toast.makeText(this, "Service Started", Toast.LENGTH_SHORT).show();
	   }

	@Override
	public void onConfigurationChanged(Configuration newConfig) {
		// TODO Auto-generated method stub
		super.onConfigurationChanged(newConfig);
	}

	@Override
	public void onCreate() {
		// TODO Auto-generated method stub
		super.onCreate();
		 Toast.makeText(this, "create Create", Toast.LENGTH_SHORT).show();
//		 for(int i=0;i<100;i++){
//			 Toast.makeText(this, i, Toast.LENGTH_SHORT).show();
////			 SystemClock.sleep(1000);
//		 }
	}

  
}
